package vip.xiaonuo.smzq.modular.lifecycle.service.entity.impl;

import  java.util.List;
import java.util.Map;
import cn.hutool.core.lang.tree.TreeNode;
import cn.hutool.core.lang.tree.TreeUtil;
import cn.hutool.core.lang.tree.Tree;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.lang.Dict;
import cn.hutool.core.map.MapUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.stereotype.Service;

import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import org.springframework.beans.factory.annotation.Autowired;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import org.springframework.transaction.annotation.Transactional;
import vip.xiaonuo.smzq.modular.lifecycle.entity.HisiKs;
import vip.xiaonuo.smzq.modular.lifecycle.mapper.entity.HisiKsMapper;
import vip.xiaonuo.smzq.modular.lifecycle.service.entity.HisiKsService;

import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
 * <p>
 * 矿山信息 服务实现类
 * </p>
 *
 * @author 于彦飞
 * @since 2024-05-09
 */
@Service("lifeCycleHisiKsService")
public class HisiKsServiceImpl extends ServiceImpl<HisiKsMapper, HisiKs> implements HisiKsService {
        @Autowired
        private HisiKsMapper hisiKsMapper;



        @Override
        public List<HisiKs>  queryHisiKsList(HisiKs hisiKs){
            List<HisiKs> list = new LambdaQueryChainWrapper<HisiKs>(hisiKsMapper).setEntity(hisiKs)
            .list();
//            DictConvertUtil.convertToDictionaryList(list,null);
            return list;
        }

        @Override
        public IPage<HisiKs> queryHisiKsListPage(HisiKs hisiKs){
            IPage<HisiKs> iPage = new LambdaQueryChainWrapper<HisiKs>(hisiKsMapper).setEntity(hisiKs)
            .page(new Page<>(hisiKs.getCurrentPageNum(),hisiKs.getPageSize()));

            List<HisiKs> records = iPage.getRecords();
//            DictConvertUtil.convertToDictionaryList(records,null);
            iPage.setRecords(records);
            return iPage;
        }


    @Override
    public boolean delHisiKs(String id){
        return this.removeById(id);
    }
    @Override
    public boolean delHisiKsBatch(List<String> ids){
        return this.removeByIds(ids);
    }

}

